The Conditional Action allows you to create conditional logic on your scene with the help of variables and logic operators.
Learn more about Variables to better understand how to use them in the Conditional Action.
How to use a Conditional Action
Under an Event, you can use a Conditional Action to wrap a group of actions that will only be triggered if the condition set is met.
Conditional Action properties
IF - Condition
Create an expression that will be the condition for actions to be triggered.
The following variable types can be used:
Variable type | Defined by | Usage |
🤹 Variables | Number, String, Boolean, Timers, Counter or Random | Variables can store values that are reusable. For detailed explanation read the Variables doc. |
ℹ️ Object Property | Object’s position, rotation, or scale (X, Y, Z), or it’s width, height and depth as a number, e.g.: 100 | Capture object property changes, and save them as variables to create advanced interactions. |
🖱️ Mouse Position (2D) | The position of the mouse on the screen is defined by X and Y as numbers. | Animate or manipulate objects based on the mouse position |
💥 Mouse Hit Position (3D) | The position of the mouse hitting an object in 3D space, as Position X, Y, or Z of the hit location, or the Position X, Y, and Z of the object that was hit. | Create interactions based on specific hit positions, e.g.: visualize hit in 3D space. |
The following operators can be used in expressions:
- Arithmetic Operators: Used to perform common mathematical operations.
- Logical Operators: Used to combine or modify boolean logic statements, where the result is either true or false.
- Comparison Operators: Used to compare two values, expressions, or variables.
- Boolean Outcomes: Represent the two possible outcomes of logical and comparison operations.
Symbol | Operator |
+ | Add |
- | Subtract |
* | Multiply |
/ | Divide |
( ) | Group calculations with parenthesis |
Symbol | Operator |
and | And |
or | Or |
! | Not |
Symbol | Operator |
== | Equal to |
!= | Not equal to |
> | Greater than |
< | Less than |
>= | Greater than or equal to |
<= | Less than or equal to |
Symbol | Outcome |
✅ | True |
❌ | False |
ELSE
Actions added under Else
will be triggered if the condition set on If
is not met.